/*
 * Copyright (c) 2005, 2014 vacoor
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 */
package org.vacoor.nothing.web.service.support.storage.mgt;

import org.vacoor.nothing.common.util.Paths;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

/**
 * @author vacoor
 */
public abstract class GeneralStorageManager implements StorageManager {

    @Override
    public void store(File file, String path) throws IOException {
        FileInputStream fis = new FileInputStream(file);
        store(fis, path);
    }

    protected String normalizePath(String path) {
        return Paths.normalize(path);
    }

    @Override
    protected void finalize() throws Throwable {
        close();
    }
}
